home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / dev / misc / FetchRefs1.3.lha / FetchRefs1.3 / Scripts / GoFetchRefs.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1996-02-24  |  1.3 KB  |  52 lines

  1. /*   $VER: GoFetchRexx.rexx 1.2 (24.2.96)
  2. **
  3. **   ARexx script to invoke FetchRefs from Shell (using rx).
  4. */
  5.  
  6. /* Set some options of ARexx */
  7. OPTIONS RESULTS
  8. OPTIONS FAILAT 21
  9.  
  10. /* Get the search strings */
  11. PARSE ARG function
  12.  
  13. /* Define a temporary filename to put the reference into */
  14. cutat = VERIFY(function, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_")
  15. filename = 'T:FR_' || LEFT(function, MAX(0, cutat - 1))
  16.  
  17. /* It doesn't matter whether we want a taglist, varargs og whatever function */
  18. IF RIGHT(function, 7) = "TagList" THEN
  19.     function = LEFT(function, LENGTH(function) - 7)
  20. ELSE IF RIGHT(function, 4) = "Tags" THEN
  21.     function = LEFT(function, LENGTH(function) - 4)
  22. ELSE IF RIGHT(function, 1) = "A" THEN
  23.     function = LEFT(function, LENGTH(function) - 1)
  24.  
  25. /* Now actually get the reference */
  26. ADDRESS 'FETCHREFS'
  27. FR_GET function || '(%|Tags|TagList|A)' filename FILEREF
  28.  
  29. /* Address editor again to load the file */
  30. ADDRESS VALUE caller
  31.  
  32. IF rc ~= 0 THEN DO
  33.     /* Some kind of error happend. Report it. This may be a simple
  34.      * "Aborted" or "No reference" message.
  35.      */
  36.     say RC2
  37.  
  38.     /* Return */
  39.     EXIT 0
  40. END
  41. ELSE DO
  42.     /* Print the reference */
  43.     ADDRESS COMMAND 'Type' filename
  44.  
  45.     /* Delete the temporary file */
  46.     ADDRESS COMMAND 'C:Delete >NIL:' filename
  47.  
  48.     /* Return */
  49.     EXIT 0
  50. END
  51.  
  52.